package com.mindainfo.groundwave.server.base.thread;

import com.mindainfo.groundwave.server.base.component.SpringFactory;
import com.mindainfo.groundwave.server.base.config.RedisConfig;
import org.apache.commons.lang3.StringUtils;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * Created by Administrator on 2017/7/20.
 */
public class BackEnd implements Runnable{
    @Override
    public void run() {
        RedisConfig redisConfig = SpringFactory.getBean(RedisConfig.class);
        JedisPool jedisPool = redisConfig.jedisPool();
        try{
            while (true){
                Jedis jedis = jedisPool.getResource();
                //获取所有的设备列表
                String devList = jedis.get("devList");
                if(StringUtils.isEmpty(devList)){
                    break;
                }



                jedis.close();
                Thread.sleep(100);
            }
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
